/**
 *  @file UTFCharConv.h
 *
 *  UTF8 <-> UTF16 conversion functions
 */

#ifndef _UTFCHARCONV_H_
#define _UTFCHARCONV_H_

#include "../common/commontypes.h"

namespace cppflib
{

namespace text
{

//! supported character set for reading/writing
typedef enum _charset
{
   CS_UTF8,
   CS_UTF16LE,
   CS_UTF16BE
} charset_t;

_DLLAPI bool IsUTF16HighSurrogate(const wc_t c);
_DLLAPI bool IsUTF16LowSurrogate(const wc_t c);
_DLLAPI int GetNumBytesForUTF8Char(const char utf8FirstByte);
_DLLAPI int UTF8ToUTF16(const char *pSrcBuf, u32_t srcLen, wc_t *pDestBuf, u32_t destLen);
_DLLAPI int UTF16ToUTF8(const wc_t *pSrcBuf, u32_t srcLen, char *pDestBuf, u32_t destLen);

}

}

#endif
